<template>
  <view>
    <operating-box>
      <t-button @click="unAdd(null)">
        <template #icon>
          <add-icon />
        </template>
        新增
      </t-button>
      <t-button theme="default" @click="onExpandAllToggle">
        <template #icon>
          <arrow-up-down1-icon />
        </template>
        展开/折叠
      </t-button>
    </operating-box>
    <!-- <QueryBox /> -->
    <table-tree ref="tableRef" />
  </view>
</template>
<script setup lang="ts">
import { AddIcon, ArrowUpDown1Icon } from 'tdesign-icons-vue-next';
import { ref } from 'vue';

import OperatingBox from '@/components/operatingBox/index.vue';
import QueryBox from '@/components/queryBox/index.vue';

import tableTree from './components/tableTree.vue';

const unAdd = (menuId: any) => {
  tableRef.value.openValue('添加菜单', menuId);
};

const tableRef = ref();
// 全部展开收起
const onExpandAllToggle = () => {
  tableRef.value.onExpandAllToggle();
};
</script>
